fix(pfe-tools): end-anchor TS redirect regex to avoid rewriting .js.map#3144
fix(pfe-tools): end-anchor TS redirect regex to avoid rewriting .js.map#3144bennypowers wants to merge 1 commit into
Conversation
|
✅ Commitlint tests passed!More Info{
"valid": true,
"errors": [],
"warnings": [],
"input": "fix(pfe-tools): end-anchor TS redirect regex to avoid rewriting .js.map"
} |
✅ Deploy Preview for patternfly-elements ready!
To edit notification comments on pull requests, go to your Netlify site settings. |
There was a problem hiding this comment.
Pull request overview
Updates the PFE dev-server request handling to improve TypeScript-source resolution when .js files are requested but only .ts sources exist in the repo, reducing 404s during local development and test runs.
Changes:
- Adjusts
liveReloadTsChangesMiddlewareto run after downstream middleware and only redirect when the response is a 404. - Removes the inline comment describing the previous regex capture-group behavior.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
zeroedin
left a comment
There was a problem hiding this comment.
LGTM on resolution of the copilot reviews
The `.js` regex in `liveReloadTsChangesMiddleware` was not end-anchored, so requests for `.js.map` (source maps) were also matched and rewritten to `.ts.map`, breaking source maps in the dev server. End-anchor the regex (`\.js$`) and use a regex replacement to ensure only the final `.js` extension is rewritten to `.ts`. Assisted-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c0b44f9 to
957c67c
Compare
Summary
.jsregex inliveReloadTsChangesMiddlewarewas not end-anchored, so requests for.js.map(source maps) were matched and rewritten to.ts.map, breaking source maps\.js$) and use regex replacement so only the final.jsextension is rewrittenTest plan
npm run devserves elements correctly.js.map) load without 404 or redirect